<script>
  function test() {
    console.log(this);
  }

  test.call({});

  Function.prototype.myCall = function (ctx, ...args) {
    ctx = ctx === null || ctx === undefined ? globalThis : Object(ctx);
    const key = Symbol();
    ctx[key] = this;
    let result = ctx[key](...args);
    delete ctx[key];
    return result;
  };

  // const xx = Array.prototype.slice.call({ 0: 1, 1: 2, length: 2 });
  // console.log(xx);
</script>
